package ar.edu.caece.compiler.grammar.attributes.tree;

import java.util.HashMap;
import java.util.Map;

import ar.edu.caece.compiler.grammar.attributes.Attribute;
import ar.edu.caece.compiler.grammar.attributes.AttributeAware;

public abstract class AttributeTreeNode extends Attribute implements AttributeAware,Generable {

	private Map<String,Attribute> attributes;
	
	public AttributeTreeNode() {
		attributes = new HashMap<String,Attribute>();
	}
	
	public void propagateRoot(NodeListaBloques nodeListaBloques) {
		
	}
	
	@Override
	public void addAttribute(String name, Attribute attribute) {
		attributes.put(name,attribute);
	}

	@Override
	public void clearAttributes() {
		attributes.clear();
	}

	@Override
	public Attribute getAttribute(String name) {
		return attributes.get(name);
	}

	@Override
	public Map<String, Attribute> getAttributes() {
		return attributes;
	}

	@Override
	public void setAttributes(Map<String, Attribute> attributes) {
		this.attributes = attributes;
	}


	public void propagarEntornoSuperior(NodeFuncProc nodeFuncProc) {
		// TODO Auto-generated method stub
		
	}
	
	public String generateCode() {
		return "\r\n*codigoPara " +this.getClass()+"*\r\n";
	}
	
	public String generateDeclaration() {
		return "";
	}


}
